<template>
    <div>
        <div id="char4" style="width: 380px; height: 250px;"></div>
    </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue';
import { ECharts, EChartsOption, init } from 'echarts';
const props = defineProps({
    data: {
        type: Object,
        default: () => { }
    }
})
onMounted(() => {
    // console.log(props.data);

    const { total, data, type } = props.data
    // 表4
    const charEle4 = document.getElementById('char4') as HTMLElement;
    const charEch4: ECharts = init(charEle4);
    const option4: EChartsOption = {
        title: {
            text: total,
            subtext: '疫苗综合消耗'
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: type,
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: data,
                type: 'line',
                areaStyle: {}
            }
        ]
    };
    charEch4.setOption(option4);
})
</script>

<style scoped>

</style>